<template>
  <div>
    <!-- Cascader 级联选择器 -->
    <div class="block">
      <!-- <span class="demonstration">默认 click 触发子菜单</span> -->
      <el-cascader
        v-show="isshow"
        v-model="value"
        :options="options"
        clearable
        @change="handleChange"
        placeholder="请选择套餐类型"
      ></el-cascader>
      <el-input v-model="input" placeholder="请输入套餐名称"></el-input>
      <el-button type="primary">搜索</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      val: "",
      input: "",
      value: [],
      options: [
        {
          value: "nanxing",
          label: "男性套餐",
        },
        {
          value: "nvxing",
          label: "女性套餐",
        },
        {
          value: "laonianren",
          label: "老年人套餐",
        },
        {
          value: "ruzhi",
          label: "入职套餐",
        },
      ],
    };
  },
  methods: {
    isshow() {
      if (this.val === "体检项目") {
        return false;
      } else {
        return true;
      }
    },
    handleChange(value) {
      console.log(value);
    },
  },
  mounted() {
    this.val = window.sessionStorage.getItem("tab");
  },
  updated() {
    this.val = window.sessionStorage.getItem("tab");
  },
};
</script>

<style lang="scss" scoped>
  @import "./scss/index.scss";
</style>